<?php
/* @var $this ProductAdminController */
/* @var $model Product */

$this->breadcrumbs=array(
	'Products'=>array('index'),
	$model->product_id,
);

$this->menu=array(
	array('label'=>'Thêm sản phẩm', 'url'=>array('create')),
	array('label'=>'Sửa', 'url'=>array('update', 'id'=>$model->product_id)),
	//array('label'=>'Xoá', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->product_id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Quản trị', 'url'=>array('admin')),
);
?>

<h1>Chi tiết sản phẩm (Mã: <?php echo $model->product_id; ?>)</h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'product_id',
		'product_name',
		'product_quantity',
		array(
            'name'=>'product_price',
            'type'=>'raw',
            'value'=>number_format($model->product_price,0,'',','),
        ),
		array(
            'name'=>'product_price_sale',
            'type'=>'raw',
            'value'=>number_format($model->product_price_sale,0,'',','),
        ),
		array(
            'name'=>'product_desc',
            'type'=>'raw',
            'value'=>html_entity_decode(CHtml::textArea('product_desc',$model->product_desc,array('class'=>'cleditor','id'=>'textarea1','cols'=>400))),
        ),
        array(
            'name'=>'product_reviews',
            'type'=>'raw',
            'value'=>html_entity_decode(CHtml::textArea('product_reviews',$model->product_reviews,array('class'=>'cleditor','id'=>'textarea1','cols'=>400))),
        ),
		array(
            'name'=>'category_id',
            'value'=>Category::model()->getCategoryName($model->category_id),
        ),
        array(
            'name'=>'brand_id',
            'value'=>($model->brand_id)?Brand::model()->getBrandName($model->brand_id):"",
        ),
		'product_timecreate',
		'product_timeupdate',                
		array(
            'name'=>'product_image',
            'type'=>'raw',
            'value'=>($model->product_image)?CHtml::image($model->product_image):"",
        ),
		array(
            'name'=>'product_image1',
            'type'=>'raw',
            'value'=>($model->product_image1)?CHtml::image($model->product_image1):'',
        ),
        array(
            'name'=>'product_image2',
            'type'=>'raw',
            'value'=>($model->product_image2)?CHtml::image($model->product_image2):'',
        ),
        array(
            'name'=>'product_image3',
            'type'=>'raw',
            'value'=>($model->product_image3)?CHtml::image($model->product_image3):'',
        ),
        array(
            'name'=>'product_image4',
            'type'=>'raw',
            'value'=>($model->product_image4)?CHtml::image($model->product_image4):'',
        ),
        array(
            'name'=>'product_image5',
            'type'=>'raw',
            'value'=>($model->product_image5)?CHtml::image($model->product_image5):'',
        ),
        array(
            'name'=>'product_image6',
            'type'=>'raw',
            'value'=>($model->product_image6)?CHtml::image($model->product_image6):'',
        ),
        array(
            'name'=>'product_image7',
            'type'=>'raw',
            'value'=>($model->product_image7)?CHtml::image($model->product_image7):'',
        ),
        array(
            'name'=>'product_image8',
            'type'=>'raw',
            'value'=>($model->product_image8)?CHtml::image($model->product_image8):'',
        ),
        array(
            'name'=>'product_image9',
            'type'=>'raw',
            'value'=>($model->product_image9)?CHtml::image($model->product_image9):'',
        ),
        array(
            'name'=>'product_video',
            'type'=>'raw',
            'value'=>($model->product_video)?'<iframe width="560" height="315" src="'.$model->product_video.'" frameborder="0" allowfullscreen></iframe>':'',
        ),
		'product_view',
		'url',
	),
)); ?>
